﻿
jzcode.event = {
    _eventDict: [],
    sendEvent: function (name, dataString) {
        for (var index = 0; index < this._eventDict.length; index++) {
            if (this._eventDict[index].name == name) {
                this._eventDict[index].callback(name, dataString);
                return;
            }
        }
    },
    registerEvent: function (name, callback) {
        for (var index = 0; index < this._eventDict.length; index++) {
            if (this._eventDict[index].name == name) {
                return;
            }
        }
        this._eventDict.push({ name: name, callback: callback });
    }
}